package com.zj.alm;

import java.util.HashMap;
import java.util.Map;

public class Answer {


    public static  boolean isDuplicate(int [] arr){
        Map<Integer,Integer> map=new HashMap<>();
        for (int i : arr) {
            if(map.containsKey(i)){
                return true;
            }else{
                map.put(i,1);
            }
        }
        return false;
    }

    public static void main(String[] args) {
        int [] arr = {1, 2, 2};
        boolean duplicate = isDuplicate(arr);
        System.out.println(duplicate);
    }
}
